package com.example.demo.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "friends", schema = "mytest", catalog = "")
public class FriendsEntity {
    private int id;
    private Integer otherUid;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "other_uid")
    public Integer getOtherUid() {
        return otherUid;
    }

    public void setOtherUid(Integer otherUid) {
        this.otherUid = otherUid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FriendsEntity that = (FriendsEntity) o;
        return id == that.id &&
                Objects.equals(otherUid, that.otherUid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, otherUid);
    }
}
